-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix WAGED to only use logicalId when computing baseline and centralize picking assignable instances in the cache #2702
Fix WAGED to only use logicalId when computing baseline and centralize picking assignable instances in the cache #2702
Conversation
…e picking assignable instances in the cache.
…eOutput into method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the change, One general question: for spectator and EV, I think there are places where we still use getInstanceConfigMap
. Will this include both swap in/out instances?
helix-core/src/main/java/org/apache/helix/model/ResourceAssignment.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/apache/helix/controller/dataproviders/BaseControllerDataProvider.java
Outdated
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/changedetector/ResourceChangeSnapshot.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/apache/helix/controller/dataproviders/BaseControllerDataProvider.java
Show resolved
Hide resolved
…icas need to be assigned based off of logicalId instead of instanceName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more question:
When we throttle rebalance with ERROR state replica, we count all replicas on swap-in and out. Do we need to ignore replicas on swap-in instance?
In IntermediateStateCalcState
@@ -239,7 +290,8 @@ private boolean validateOfflineInstancesLimit(final ResourceControllerDataProvid | |||
final HelixManager manager) { | |||
int maxOfflineInstancesAllowed = cache.getClusterConfig().getMaxOfflineInstancesAllowed(); | |||
if (maxOfflineInstancesAllowed >= 0) { | |||
int offlineCount = cache.getAllInstances().size() - cache.getEnabledLiveInstances().size(); | |||
int offlineCount = | |||
cache.getAssignableInstances().size() - cache.getAssignableEnabledLiveInstances().size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here might be tricky for Evacuate. For swap, because swap-in instances are mirror, so it is not considered in offline limit for EMM. But Evacuate will reduce capacity, we may want to separate these 2 cases.
Not related to this change though.
helix-core/src/main/java/org/apache/helix/controller/rebalancer/DelayedAutoRebalancer.java
Outdated
Show resolved
Hide resolved
Failed tests on previous execution failed due to known flaky tests: Test failed: testGetAllInstances(org.apache.helix.rest.server.TestInstancesAccessor) #2667 (there is PR for fix on this one) I was able to pass both of these tests locally. |
helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
Outdated
Show resolved
Hide resolved
Will be addressing this in a future PR for spectator. |
Will add comment with TODO to address 2->3 ST messages not being sent and throttled due to more messages being sent to SWAP_IN and counting against throttles. This is also a known issue already and we should figure out a way to prioritize ST messages. |
Had an offline review session and discussed several points. Generally looking good. Thanks for working on this! |
…out hosts it in top or second top state, add throttling todos, and move assignable maps in cache out of propert cache block.
…eLogicalIds with stream instead of parallelStream to prevent concurrent modification exception.
… the same cluster as TestPerInstanceAccessor which adds an evacuate instance to the cluster. Any time TestPerInstanceAccessor runs first, it will cause TestInstanceAccessor.getAllInstances to fail. Using a new cluster for TestInstanceAccessor fixes the issue.
Was able to fix TestInstanceAccessor.getAllInstances test. Test failed: testCacheDataUpdates(org.apache.helix.metaclient.impl.zk.TestZkMetaClientCache) #2693 which is now fixed by #2705 Assuming that review looks good, this PR is ready to be merged. Final Commit Message: |
Thank you so much for the review @xyuanlu! This PR is ready to be merged. Final Commit Message: |
310b946
into
apache:ApplicationClusterManager
…e picking assignable instances in the cache. (#2702) Fix WAGED to only use logicalId when computing baseline and centralize picking assignable instances in the cache.
…e picking assignable instances in the cache. (#2702) Fix WAGED to only use logicalId when computing baseline and centralize picking assignable instances in the cache.
…e picking assignable instances in the cache. (#2702) Fix WAGED to only use logicalId when computing baseline and centralize picking assignable instances in the cache.
Issues
We found that there was significant shuffling occurring when attempting to perform a Node Swap operation on WAGED clusters. #2662
Description
After investigating, it was determined that the cause was due to the PartitionMovementConstraint and BaselineInfluenceConstraint soft constraints improperly scoring AssignableReplicas during the completion of a SWAP.
This was because those two soft-constraints were using InstanceName instead of LogicaId to determine if the SWAP_IN node was in the baseline or best possible state. It wouldn't be since the last time that the algorithm produced the baseline and best possible state, it contained the SWAP_OUT node instead. This causes the score to be lower and leads to incorrect assignment.
To fix this, those soft-constraints now look for LogicalId and the baseline and best possible state are passed in with instanceName replaced with logicalId.
Also, we are putting all of the logic for what instance's are assignable in one place, the BaseControllerDataProvider. We will also add Evacuation here in the future.
Tests
The previous integration tests have been modified to cover the changes.
We have also tested this logic on a production cluster copied to a testing environment.
Changes that Break Backward Compatibility (Optional)
NA
Despite adding new getters to BaseControllerDataProvider, the old signatures are kept with the same behavour.
Commits
Code Quality
(helix-style-intellij.xml if IntelliJ IDE is used)